package com.zsc.yadada.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zsc.yadada.common.DeleteRequest;
import com.zsc.yadada.model.dto.app.AppQueryRequest;
import com.zsc.yadada.model.dto.app.AppUpdateRequest;
import com.zsc.yadada.model.entity.App;
import com.baomidou.mybatisplus.extension.service.IService;
import com.zsc.yadada.model.entity.User;
import com.zsc.yadada.model.vo.AppVO;

import javax.servlet.http.HttpServletRequest;

/**
 *
 */
public interface AppService extends IService<App> {

    /**
     * 获取应用封装类
     * @param appPage
     * @param request
     * @return
     */
    Page<AppVO> getAppVOPage(Page<App> appPage, HttpServletRequest request);

    /**
     * 校验数据（鱼皮封装的校验参数方法）
     *
     * @param app
     * @param add 对创建的数据进行校验
     */
    void validApp(App app, boolean add);

    /**
     * 获取查询条件（鱼皮封装的方法）
     * @param appQueryRequest
     * @return
     */
    QueryWrapper<App> getQueryWrapper(AppQueryRequest appQueryRequest);

    /**
     * 删除用户
     * @param deleteRequest
     * @param loginUser
     * @return
     */
    boolean deleteApp(DeleteRequest deleteRequest, User loginUser);

    /**
     * 更新应用
     * @param appUpdateRequest
     * @return
     */
    boolean updateApp(AppUpdateRequest appUpdateRequest);

    /**
     * 根据id获取应用
     * @param id
     * @return
     */
    AppVO getAppById(Long id);


}
